import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'

// 引入自动导入组件
// import 自动导入 from 'unplugin-auto-import/vite'
// import 组件 from 'unplugin-vue-components/vite'
// import {ElementPlusResolver as 组件解析器} from 'unplugin-vue-components/resolvers'

// 引入 tailwind
import tailwindcss from '@tailwindcss/vite'

// https://vite.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    vueDevTools(),
    // 自动导入({
    //   resolvers: [组件解析器()]
    // }),
    // 组件({
    //   resolvers: [组件解析器()]
    // }),
    tailwindcss(),
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    },
  },
})
